package com.irdstudio.efp.esb.api.rest.nls;

import static com.irdstudio.basic.sequence.service.DefaultPatternDescriptor.SEQ;

import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.*;

import javax.servlet.http.HttpServletRequest;

import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.irdstudio.basic.framework.core.constant.*;
import com.irdstudio.basic.framework.core.util.*;
import com.irdstudio.basic.framework.core.util.sdic.SDicToExternal;
import com.irdstudio.basic.framework.core.util.sdic.SDicToLocal;
import com.irdstudio.efp.esb.common.constant.InstitutionEnums;
import com.irdstudio.efp.esb.service.vo.BigShowVO;
import com.irdstudio.efp.nls.common.util.KafkaUtil;
import org.apache.rocketmq.common.message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.irdstudio.basic.framework.core.constant.*;
import com.irdstudio.basic.framework.core.exception.BizException;
import com.irdstudio.basic.framework.core.util.*;
import com.irdstudio.basic.framework.core.util.sdic.SDicToExternal;
import com.irdstudio.basic.framework.core.util.sdic.SDicToLocal;
import com.irdstudio.basic.sequence.service.DefaultPatternDescriptor;
import com.irdstudio.basic.sequence.service.PatternDescriptor;
import com.irdstudio.basic.sequence.service.facade.PatternedLimitableSeqService;
import com.irdstudio.efp.basic.framework.mq.client.producer.MQProducerMessageClient;
import com.irdstudio.efp.basic.framework.mq.constant.TagEnums;
import com.irdstudio.efp.basic.framework.mq.constant.TopicEnums;
import com.irdstudio.efp.console.service.facade.PrdAdaptedSoltService;
import com.irdstudio.efp.console.service.facade.PrdInfoService;
import com.irdstudio.efp.console.service.facade.PubSysInfoService;
import com.irdstudio.efp.console.service.vo.PrdInfoVO;
import com.irdstudio.efp.cus.service.facade.CusIndivService;
import com.irdstudio.efp.esb.api.bean.nls.ReqLoanAppBean;
import com.irdstudio.efp.esb.api.bean.nls.RespLoanAppBean;
import com.irdstudio.efp.esb.api.common.EsbRespServiceBeanCreator;
import com.irdstudio.efp.esb.api.common.GroupeInterface.ms;
import com.irdstudio.efp.esb.api.common.SDicServerConstant;
import com.irdstudio.efp.esb.api.util.SDicMappingServer;
import com.irdstudio.efp.esb.common.constant.EsbBizEnums;
import com.irdstudio.efp.esb.common.constant.EsbSysHeadEnums;
import com.irdstudio.efp.esb.common.constant.InstitutionEnums;
import com.irdstudio.efp.esb.common.constant.MsLoanConstant;
import com.irdstudio.efp.esb.common.server.req.EsbReqServiceBean;
import com.irdstudio.efp.esb.common.server.resp.EsbRespServiceBean;
import com.irdstudio.efp.nls.common.constant.QueueTaskEnums;
import com.irdstudio.efp.nls.service.facade.NlsApplyInfoService;
import com.irdstudio.efp.nls.service.facade.NlsApplyRelationService;
import com.irdstudio.efp.nls.service.facade.ms.MsZxInfoService;
import com.irdstudio.efp.nls.service.facade.queue.NlsProcessBizService;
import com.irdstudio.efp.nls.service.vo.MsZxInfoVO;
import com.irdstudio.efp.nls.service.vo.NlsApplyInfoVO;
import com.irdstudio.efp.nls.service.vo.NlsApplyRelationVO;
import com.irdstudio.efp.nls.service.vo.queue.NlsProcessBizVO;
import org.apache.rocketmq.common.message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Objects;

import static com.irdstudio.basic.sequence.service.DefaultPatternDescriptor.SEQ;

/**
 * 服务名称 ：30220001(贷款申请管理)<br>
 * 服务场景名称：01(进件申请) <br>
 * 服务描述：用户向相关银行申请贷款业务的处理 <br>
 * 服务场景描述：用户通过相关平台向网贷系统发送证件类型、贷款金额、天数等相关资料信息，由此发起贷款申请； <br>
 * 
 * @author huangwb
 * @since 2019年1月18日 下午7:40:24
 * @version 1.0
 */
@RestController
@RequestMapping("/esb")
public class NlsApplyController {
	private static Logger logger = LoggerFactory.getLogger(NlsApplyController.class);
	public static final PatternDescriptor PATTERN = DefaultPatternDescriptor.of("S" + SEQ, 9);

	// kafka主机IP地址
	// kafka端口号
	@Value("${bigshow.servers}")
	private String servers;

	// kafka发送的主题topic
	@Value("${bigshow.kafkaToptic}")
	private String kafkaToptic;


	/**
	 * 获取ESB请求对象，校验 ESB请求系统头和请求应用头对象
	 * 
	 * @param request
	 *            请求对象集合
	 * @return
	 * @author huangwb
	 * @since 2019年1月20日 下午1:28:08
	 * @version 1.0
	 */
	@ModelAttribute("esbReqServiceBean")
	public EsbReqServiceBean getReqEsbHeadBean(HttpServletRequest request) {
		logger.info("校验 ESB请求系统头和请求应用头对象!");
		EsbReqServiceBean esbReqServiceBean = (EsbReqServiceBean) request.getAttribute("esbReqServiceBean");
		return esbReqServiceBean;
	}

	/**
	 * 获取ESB请求对象，校验 ESB请求体对象
	 * 
	 * @param request
	 *            请求对象集合
	 * @return
	 * @author huangwb
	 * @since 2019年1月20日 下午1:31:14
	 * @version 1.0
	 */
	@ModelAttribute("reqLoanAppBean")
	public ReqLoanAppBean getReqEsbBodyBean(HttpServletRequest request) {
		logger.info("校验 ESB请求体对象！");
		String esbReqBody = (String) request.getAttribute("esbReqBody");
		return JSONObject.parseObject(esbReqBody, ReqLoanAppBean.class);
	}

	/**
	 * 1.通过切面校验进件申请参数是否正确，如不正确则返回错误信息<br>
	 * 2.调用对应的中台服务<br>
	 * 3.增加调用队列任务表信息<br>
	 * TODO:此处为统一的进件交易，先暂时不按照产品代码进行划分，后续根据差异化需求决定是否拆分；<br>
	 * V1.1:huangwb:增加交易码
	 * 
	 * @param esbReqServiceBean
	 *            ESB请求对象
	 * @param br1
	 * @param reqLoanAppBean
	 *            ESB请求体的对象
	 * @param br2
	 * @param exception
	 *            切面的异常信息
	 * @return
	 * @throws Exception
	 * @author huangwb
	 * @since 2019年1月20日 下午2:20:51
	 * @date 2019年3月4日 下午2:41:17
	 * @version 1.1
	 */

	@PostMapping("/SERVICE_30220001_01_01020001")
	public EsbRespServiceBean doRecv(@Validated @ModelAttribute("esbReqServiceBean") EsbReqServiceBean esbReqServiceBean, BindingResult br1,
			@Validated({ms.class}) @ModelAttribute("reqLoanAppBean") ReqLoanAppBean reqLoanAppBean, BindingResult br2, Exception exception)
			throws Exception {
		String applSeq = reqLoanAppBean.getAppFlowNo();
		String glblSrlNo = esbReqServiceBean.getSysHead().getGlblSrlNo();
		TraceUtil.setTraceId(glblSrlNo);
		logger.info("马上进件申请交易开始----------申请流水号：" + applSeq + "------------全局流水号" + glblSrlNo);
		try {
			// 1.通过切面校验进件申请参数是否正确，如不正确则返回错误信息
			if (Objects.nonNull(exception)) {
				throw exception;
			}
			// 2.获取业务逻辑字段
			String cusName = reqLoanAppBean.getBrwNm();
			/** 【修改】 @qiuyf 2019/01/28 【原语句】String certType = reqLoanAppBean.getCertTp(); */
			String certType = SDicMappingServer.getLocalSysDicVal(SDicServerConstant.CERT_TYPE, reqLoanAppBean.getCertTp());
			String certNo = reqLoanAppBean.getCertNo();
			String certAddr = reqLoanAppBean.getCertAddr();
			String mobile = reqLoanAppBean.getMblNo();
			String prdCde = reqLoanAppBean.getProdCd();
			String prdName = reqLoanAppBean.getLoanProdNm();
			String loanAmt = reqLoanAppBean.getLoanAmt();
			String loanTerm = reqLoanAppBean.getLoanTrm();
			String loanTermType = SDicToLocal.getLocalSysDicVal(SDicToLocalConstant.TERM_TYPE, reqLoanAppBean.getLoanTrmType());
			String ethnic = reqLoanAppBean.getEthnic();
			/** 【修改】 @qiuyf 2019/01/28 【原语句】String edu = reqLoanAppBean.getEdu(); */
			String edu = SDicMappingServer.getLocalSysDicVal(SDicServerConstant.DEGREE, reqLoanAppBean.getEdu());
			String wrkCorpNm = reqLoanAppBean.getWrkCorpNm();
			String wrkCorpAddr = reqLoanAppBean.getWrkCorpAddr();
			String mrgSitu = reqLoanAppBean.getMrgSitu();
			String spsNm = reqLoanAppBean.getSpsNm();
			String ttl = reqLoanAppBean.getTtl();
			
			// 3.1.字段值合规性校验
			if ("20".equals(mrgSitu) || "21".equals(mrgSitu) || "22".equals(mrgSitu) || "23".equals(mrgSitu)) {// 婚姻判断
				if ("".equals(spsNm) || spsNm == null) {
					logger.debug("配偶姓名不能为空。组装报文返回**************");
					return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean, 
							JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.KHXXJYBTG.getValue(), "配偶姓名不能为空")), 
							EsbSysHeadEnums.RetStEnum.FAILURE.getCode(),  EsbRetCodeStandard.KHXXJYBTG.getValue(), "配偶姓名不能为空");
				}
			}
			MessageRuleCheckUtil.validateIdNo18(certNo, EsbRetCodeStandard.KHXXJYBTG.getValue());// 身份证
			boolean flag = ValidationUtils.validPhoneNum("0", mobile);// 手机号
			if (!flag) {
				return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean, 
						JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.KHXXJYBTG.getValue(), "手机号错误")), 
						EsbSysHeadEnums.RetStEnum.FAILURE.getCode(),  EsbRetCodeStandard.KHXXJYBTG.getValue(), "手机号错误");
			}
			
			/*String bankFlag = ValidationUtils.luhmCheck(bankCardNo);
			if(!"true".equals(bankFlag)) {
				return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean, 
						JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.KHXXJYBTG.getValue(), bankFlag)), 
						EsbSysHeadEnums.RetStEnum.FAILURE.getCode(),  EsbRetCodeStandard.KHXXJYBTG.getValue(), bankFlag);
			}*/
			
			MessageRuleCheckUtil.checkDouble(loanAmt, "贷款金额", EsbRetCodeStandard.CPXXJYBTG.getValue());
			MessageRuleCheckUtil.checkInteger(loanTerm, "贷款期限", EsbRetCodeStandard.CPXXJYBTG.getValue());
			
			if (!"3".equals(loanTerm) && !"6".equals(loanTerm) && !"9".equals(loanTerm) && !"12".equals(loanTerm)) {// 贷款期限判断
				logger.debug("产品贷款期限错误。组装报文返回**************");
				return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean, 
						JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.CPXXJYBTG.getValue(), "产品贷款期限错误")), 
						EsbSysHeadEnums.RetStEnum.FAILURE.getCode(),  EsbRetCodeStandard.CPXXJYBTG.getValue(), "产品贷款期限错误");
			}
			
			// 3.2.验证客户是否存在
			// 根据身份证获取客户号
			String cusId = cusIndivService.getCusIdByCertCode(certType, certNo);
			if (cusId == null) {
				cusId = "";
			}
			// 根据产品代码查询产品id
			PrdInfoVO vo = new PrdInfoVO();
			vo.setPrdCode(prdCde);
			PrdInfoVO outputVo = prdInfoService.queryLastPrdInfo(vo);
			if (outputVo == null || "".equals(outputVo.getPrdId())) {
				logger.debug("无产品id。组装报文返回**************");
				return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean, 
						JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.CPXXJYBTG.getValue(), "无产品id")), 
						EsbSysHeadEnums.RetStEnum.FAILURE.getCode(),  EsbRetCodeStandard.CPXXJYBTG.getValue(), "无产品id");
			}
			// 4.调用中台服务
			// 插入网贷申请基本信息表
			NlsApplyInfoVO nlsApplyInfoVO = new NlsApplyInfoVO();
			nlsApplyInfoVO.setApplySeq(applSeq);// 流水号
			nlsApplyInfoVO.setCusId(cusId);// 客户id
			nlsApplyInfoVO.setCusName(cusName);// 姓名
			nlsApplyInfoVO.setCertType(certType);// 证件类型
			nlsApplyInfoVO.setCertCode(certNo);// 证件号码
			nlsApplyInfoVO.setCertAddr(certAddr);// 证件地址
			nlsApplyInfoVO.setIndivIdExpDt(reqLoanAppBean.getCertMatureDt() == null ? "" : reqLoanAppBean.getCertMatureDt());// 证件到期日
			nlsApplyInfoVO.setMobile(mobile);// 手机号码
			nlsApplyInfoVO.setPrdId(outputVo.getPrdId());// 产品id
			nlsApplyInfoVO.setPrdCode(prdCde);// 产品代码
			nlsApplyInfoVO.setPrdName(prdName);// 产品名称
			nlsApplyInfoVO.setCusGender(reqLoanAppBean.getBrwGnd() == null ? "" : reqLoanAppBean.getBrwGnd());// 性别
			/**
			 * 【修改】 @qiuyf 2019/01/28 【原语句】
			 * nlsApplyInfoVO.setCusNational(reqLoanAppBean.getNation() == null ? "CHN" :
			 * reqLoanAppBean.getNation());// 国籍
			 */
			nlsApplyInfoVO.setCusNational(reqLoanAppBean.getNation() == null ? CountryConstant.CHN
					: SDicMappingServer.getLocalSysDicVal(SDicServerConstant.COUNTRY, reqLoanAppBean.getNation()));// 国籍
			/**
			 * 【修改】 @qiuyf 2019/01/28 【原语句】
			 * nlsApplyInfoVO.setProfession(reqLoanAppBean.getCrr() == null ? "" :
			 * reqLoanAppBean.getCrr());// 职业
			 */
			nlsApplyInfoVO.setProfession(reqLoanAppBean.getCrr() == null ? ""
					: SDicMappingServer.getLocalSysDicVal(SDicServerConstant.CRR, reqLoanAppBean.getCrr()));// 职业
			nlsApplyInfoVO.setApplyAmt(new BigDecimal(loanAmt));// 贷款金额
			nlsApplyInfoVO.setLoanTerm(loanTerm);// 贷款期限
			certType = SDicToExternal.getExternalSysDicVal(SDicToExternalConstant.SYSID_OCM, SDicToExternalConstant.CERT_TYPE, certType);

			nlsApplyInfoVO.setLoanTermType(loanTermType);// 期限类型
			nlsApplyInfoVO.setNlsOperOrgid(outputVo.getOrgCode() == null ? "" : outputVo.getOrgCode());// 网贷经办机构：赋值为产品中取出的归属机构org_code
			nlsApplyInfoVO.setLoanPurpose(reqLoanAppBean.getBrwUsg() == null ? "" : reqLoanAppBean.getBrwUsg());// 借款用途
			nlsApplyInfoVO.setRecvAcctNo(reqLoanAppBean.getBankCardNo() == null ? "" : reqLoanAppBean.getBankCardNo());// 银行卡号
			nlsApplyInfoVO.setRecvBankName(reqLoanAppBean.getBankNm() == null ? "" : reqLoanAppBean.getBankNm());// 银行卡号
			nlsApplyInfoVO.setApplyDate(reqLoanAppBean.getTrdPtyAppDt() == null ? "" : reqLoanAppBean.getTrdPtyAppDt());// 申请日期
			nlsApplyInfoVO.setApplyTime(DateUtility.getCurrAppTimeStr());// 申请时间（当前机器时间）
			nlsApplyInfoVO.setCreateUser("admin");// 创建人（直接插值）
			nlsApplyInfoVO.setCreateTime(DateUtility.getCurrAppDateTimeString());// 创建时间
			nlsApplyInfoVO.setLastModifyUser("admin");// 最后修改人（ 直接插值）
			nlsApplyInfoVO.setLastModifyTime(DateUtility.getCurrAppDateTimeString());// 最后修改时间
			nlsApplyInfoVO.setLoanCcy(CurrencyConstant.CNY);// 贷款币种
			nlsApplyInfoVO.setNlsApplyState(MsLoanConstant.NlsApplyStateEnum.APPR.VALUE);// 处理中
			nlsApplyInfoVO.setEthnic(ethnic);// 民族
			nlsApplyInfoVO.setEdu(edu);// 学历
			nlsApplyInfoVO.setWrkCorpNm(wrkCorpNm);// 工作单位名称
			nlsApplyInfoVO.setWrkCorpAddr(wrkCorpAddr);// 工作单位地址
			nlsApplyInfoVO.setMrgSitu(mrgSitu);// 婚姻状况
			nlsApplyInfoVO.setSpsNm(spsNm);// 配偶姓名
			nlsApplyInfoVO.setTtl(ttl);// 职称
			nlsApplyInfoVO.setBrthDt(reqLoanAppBean.getBrthDt());// 出生日期
			nlsApplyInfoVO.setWrkCorpTel(StringUtil.replaceNullByObj(reqLoanAppBean.getWrkCorpTel()));// 工作单位电话
			nlsApplyInfoVO.setFamAddr(StringUtil.replaceNullByObj(reqLoanAppBean.getFamAddr()));// 家庭地址
			nlsApplyInfoVO.setAplCmmAddr(StringUtil.replaceNullByObj(reqLoanAppBean.getAplCmmAddr()));// 申请人通讯地址
			nlsApplyInfoVO.setFamTelNo(StringUtil.replaceNullByObj(reqLoanAppBean.getFamTelNo()));// 家庭电话
			nlsApplyInfoVO.setMblTelNo(StringUtil.replaceNullByObj(reqLoanAppBean.getMblTelNo()));// 移动电话
			nlsApplyInfoVO.setIndvIncmAmt(StringUtil.replaceNullByObj(reqLoanAppBean.getIndvIncmAmt()).equals("") ? BigDecimal.ZERO
					: new BigDecimal(reqLoanAppBean.getIndvIncmAmt()));// 个人月收入
			nlsApplyInfoVO.setFamIncmAmt(StringUtil.replaceNullByObj(reqLoanAppBean.getFamIncmAmt()).equals("") ? BigDecimal.ZERO
					: new BigDecimal(reqLoanAppBean.getFamIncmAmt()));// 家庭月收入
			nlsApplyInfoVO.setSpsCtcTelNo(StringUtil.replaceNullByObj(reqLoanAppBean.getSpsCtcTelNo()));// 配偶联系电话
			nlsApplyInfoVO.setSpsMblTelNo(StringUtil.replaceNullByObj(reqLoanAppBean.getSpsMblTelNo()));// 配偶移动电话
			nlsApplyInfoVO.setPstcd(StringUtil.replaceNullByObj(reqLoanAppBean.getPstcd()));// 邮编
			nlsApplyInfoVO.setWhthrFrmr(StringUtil.replaceNullByObj(reqLoanAppBean.getWhthrFrmr()));// 是否农户
			nlsApplyInfoVO.setCorpChar(StringUtil.replaceNullByObj(reqLoanAppBean.getCorpChar()));// 单位性质
			nlsApplyInfoVO.setChannelNo(outputVo.getPrdType());// 渠道编号
			nlsApplyInfoVO.setGlobalSerno(esbReqServiceBean.getSysHead().getGlblSrlNo());// 全局流水号
			nlsApplyInfoVO.setIndivRsdAddr(certAddr);// 居住地址
			nlsApplyInfoVO.setPlatfmId(esbReqServiceBean.getSysHead().getPlafmID());// 平台ID
			nlsApplyInfoVO.setPlatfmUsrID(esbReqServiceBean.getSysHead().getPlafmUsrID());// 平台用户ID
			nlsApplyInfoVO.setCnsmrTxnCd(esbReqServiceBean.getSysHead().getCnsmrSysID());// 交易码
			nlsApplyInfoVO.setSoltStage("1");//插槽阶段
			// 2019/10/31 modify by ludayong
			nlsApplyInfoVO.setLoanDueDate(reqLoanAppBean.getLoanMatureDt());//贷款到期日
            // add by ludayong 2019/11/15 【数据权限】增加网贷经办机构赋值
			// 网贷经办机构
			nlsApplyInfoVO.setNlsOperOrgid(InstitutionEnums.InstitutionEnum.GZYHZHYHZXSCTD2.getCode());
			int num1 = nlsApplyInfoService.insertNlsApplyInfo(nlsApplyInfoVO);

			// 插入网贷申请联系人信息表
			NlsApplyRelationVO nlsApplyRelationVo = new NlsApplyRelationVO();
			nlsApplyRelationVo.setRelApptSeq(getCusId());// 主键流水号
			nlsApplyRelationVo.setApplySeq(applSeq);// 申请流水号
			nlsApplyRelationVo.setCusId(cusId);// 客户id
			nlsApplyRelationVo.setCusName(cusName);// 姓名
			nlsApplyRelationVo.setCertType(certType);// 证件类型
			nlsApplyRelationVo.setCertCode(certNo);// 证件号码
			nlsApplyRelationVo.setRelName(reqLoanAppBean.getCtcPrsnNm() == null ? "" : reqLoanAppBean.getCtcPrsnNm());// 联系人姓名
			/**
			 * 【修改】 @qiuyf 2019/01/28 【原语句】
			 * nlsApplyRelationVo.setRelRelation(reqLoanAppBean.getCtcPrsnRela() == null ?
			 * "" : reqLoanAppBean.getCtcPrsnRela());// 联系人关系
			 */
			nlsApplyRelationVo.setRelRelation(reqLoanAppBean.getCtcPrsnRela() == null ? ""
					: SDicMappingServer.getLocalSysDicVal(SDicServerConstant.CONSTACTS_RELATION, reqLoanAppBean.getCtcPrsnRela()));// 联系人关系
			nlsApplyRelationVo.setCreateTime(DateUtility.getCurrAppDateTimeString());// 创建时间
			nlsApplyRelationVo.setLastChgTime(DateUtility.getCurrAppDateTimeString());// 最后修改时间
			int num2 = nlsApplyRelationService.insertNlsApplyRelation(nlsApplyRelationVo);

			// 插入网贷业务过程表
			NlsProcessBizVO inNlsProcessBizVo = new NlsProcessBizVO();
			inNlsProcessBizVo.setApplySeq(applSeq);// 申请流水号
			inNlsProcessBizVo.setCusId(cusId);// 客户编号
			inNlsProcessBizVo.setCusName(cusName);// 客户名称
			inNlsProcessBizVo.setPrdId(outputVo.getPrdId());// 产品ID
			inNlsProcessBizVo.setPrdCode(prdCde);// 产品代码
			inNlsProcessBizVo.setPrdName(prdName);// 产品名称
			inNlsProcessBizVo.setHangTimes(QueueTaskEnums.QueueHangTimesEnum.INITIALIZE.getTimes());
			inNlsProcessBizVo.setQueueTaskState(QueueTaskEnums.QueueTaskStateEnum.EXECUTORY.getCode());

			inNlsProcessBizVo.setCreateTime(DateUtility.getCurrAppDateTimeString());// 创建时间
			inNlsProcessBizVo.setLastModifyTime(DateUtility.getCurrAppDateTimeString());// 最后修改时间
			inNlsProcessBizVo.setCreateDate(DateUtility.getCurrAppDateStr());// 创建日期
			// add by ludayong 2019/11/15 【数据权限】增加经办机构赋值
			// 经办机构
			inNlsProcessBizVo.setNlsOperOrgid(InstitutionEnums.InstitutionEnum.GZYHZHYHZXSCTD2.getCode());
			int num3 = nlsProcessBizService.insertNlsProcessBiz(inNlsProcessBizVo);

			//================================插入征信信息到征信信息表start=====================================
			MsZxInfoVO msZxInfoVo = new MsZxInfoVO();
			msZxInfoVo.setApplySeq(applSeq);//申请流水号
			msZxInfoVo.setCusName(cusName);//客户名称
			msZxInfoVo.setCertType(certType);//证件类型
			msZxInfoVo.setCertCode(certNo);//证件号
			msZxInfoVo.setApplyDate(reqLoanAppBean.getTrdPtyAppDt() == null ? "" : reqLoanAppBean.getTrdPtyAppDt());//申请日期
			msZxInfoVo.setApplyTime(DateUtility.getCurrAppTimeStr());//申请时间
			msZxInfoVo.setGzyhAmtcHclacc(reqLoanAppBean.getNonCnslAcctCrCardHghstCr());//未销户贷记卡单家行最高授信额
			msZxInfoVo.setGzyhAmtcClop(reqLoanAppBean.getNonCnslAcctCrCardTotCrLmt());//未销户贷记卡总授信额度
			msZxInfoVo.setGzyhAmtcUtlcop(reqLoanAppBean.getNonCnslAcctCrCardUsedLmt());//未销户贷记卡已使用额度
			msZxInfoVo.setGzyhAmtcHtpdever(reqLoanAppBean.getNonCnslAcctCrCardOdueAmt() );//未销户贷记卡逾期单月最高逾期总额
			msZxInfoVo.setGzyhNumlLpos(reqLoanAppBean.getLoanCrLoanBrchCnt());//贷款授信贷款机构数
			msZxInfoVo.setGzyhTotalLoanOverdueNum(reqLoanAppBean.getLoanAcmlnOdue());//贷款最近24个月累计逾期期数
			msZxInfoVo.setGzyhInd(reqLoanAppBean.getPBCIdy());//人行行业
			msZxInfoVo.setGzyhIsEnforement(reqLoanAppBean.getWhthrExstEnfrcExec());//是否存在强制执行
			msZxInfoVo.setGzyhTotaCrelOverdueNum(reqLoanAppBean.getCrCardAcmlnOdue());//信用卡最近24个月累计逾期期数
			msZxInfoVo.setGzyhSmallCNum(reqLoanAppBean.getSmlLndBrchCrBrchCnt());//小贷机构授信机构数
			msZxInfoVo.setGzyhSmallLoanNum(reqLoanAppBean.getSmlLndBrchHvLndBrchCnt());//小贷机构有贷机构数
			msZxInfoVo.setGzyhSmallLoanLoanNum(reqLoanAppBean.getSmlLndBrchHvLndDbllCnt());//小贷机构有贷借据数
			msZxInfoVo.setGzyhFinancialCreditInsNum(reqLoanAppBean.getCnsmnFinBrchCrBrchCnt());//消费金融机构授信机构数
			msZxInfoVo.setGzyhFinancialLoanInsNum(reqLoanAppBean.getCnsmnFinBrchHvLndBrchCnt());//消费金融机构有贷机构数
			msZxInfoVo.setGzyhFinancialLoanLoanInsNum(reqLoanAppBean.getCnsmnFinBrchHvLndDbllCnt());//消费金融机构有贷借据数
			msZxInfoVo.setGzyhLCOverdue(reqLoanAppBean.getCrCardOdueFlg1());//贷记卡逾期标志
			msZxInfoVo.setGzyhLSOverdue(reqLoanAppBean.getQscrdtOdueFlg1());//准贷记卡逾期标志
			msZxInfoVo.setGzyhLLOverdue(reqLoanAppBean.getLoanOdueFlg());//贷款逾期标志
			msZxInfoVo.setGzyhLCOverdueNum(reqLoanAppBean.getCrCardCrnOdueTrmCnt());//贷记卡当前逾期期数
			msZxInfoVo.setGzyhLCCpdSum(reqLoanAppBean.getCrCardCrnOdueAmt());//贷记卡当前逾期金额
			msZxInfoVo.setGzyhCurrentQuotaUsage(reqLoanAppBean.getCrCardCrnLmtUseRt());//贷记卡当前额度使用率
			msZxInfoVo.setGzyhLCNo0CardNum(reqLoanAppBean.getCrCardShetCnt1());//余额不为0贷记卡张数
			msZxInfoVo.setGzyhUnOverMortgageLoanNum(reqLoanAppBean.getUncldHsngMrtgeLoanCnt());//未结清住房按揭贷款笔数
			msZxInfoVo.setGzyhUnOverBusinessLoanNum(reqLoanAppBean.getUncldCrpnLoanCnt());//未结清经营性贷款笔数
			msZxInfoVo.setGzyhUnOverOtherLoanNum(reqLoanAppBean.getUncldLoanCnt());//未结清贷款笔数
			msZxInfoVo.setGzyhNumGuacmp(reqLoanAppBean.getGnrCmpnstFlg());//保证人代偿标志
			msZxInfoVo.setGzyhNumTbd(reqLoanAppBean.getExstBdDbtFlg());//存在呆账标志
			msZxInfoVo.setGzyhIsNumExtwrt(reqLoanAppBean.getExtGrntFlg());//对外担保标志
			msZxInfoVo.setGzyhNumAssdsp(reqLoanAppBean.getAstDispFlg());//资产处置标志
			msZxInfoVo.setGzyhNumlOs(reqLoanAppBean.getUncldLoanInfSmzg());//未结清贷款信息汇总
			msZxInfoVo.setGzyhLCAbnormalCard(reqLoanAppBean.getWhthrAbnStCrCard());//是否异常状态贷记卡
			msZxInfoVo.setGzyhLSAbnormalCard(reqLoanAppBean.getWhthrAbnStQscrdt());//是否异常状态准贷记卡
			msZxInfoVo.setGzyhLLAbnormalLoan(reqLoanAppBean.getWhthrExstAbnLoan());//是否存在异常贷款
			msZxInfoVo.setGzyhStuMrg(reqLoanAppBean.getMrtlSitu1());//婚姻状况1
			msZxInfoVo.setGzyhDiploma(reqLoanAppBean.getHghstEdu());//最高学历
			msZxInfoVo.setGzyhDegree(reqLoanAppBean.getHghstDgr());//最高学位
			msZxInfoVo.setGzyhAmtlOsbal(reqLoanAppBean.getLoanCrBal());//贷款授信余额
			msZxInfoVo.setGzyhAmtlApos6m(reqLoanAppBean.getLoanCrRctly6MosAvRpymnt());//贷款授信最近6个月平均应还款
			msZxInfoVo.setGzyhNumcLpop(reqLoanAppBean.getCrCardCrLoanBrchCnt());//贷记卡授信贷款机构数
			msZxInfoVo.setGzyhAmtcAutlcop6m(reqLoanAppBean.getCrCardCrRctly6MosAvUseLmt() );//贷记卡授信最近6个月平均使用额度
			msZxInfoVo.setGzyhNumExtwrt(reqLoanAppBean.getGrntCnt());//担保笔数
			msZxInfoVo.setGzyhAtmExtwrt(reqLoanAppBean.getGrntPnpBal());//担保本金余额
			msZxInfoVo.setGzyhHousingLoans(reqLoanAppBean.getHsngLoanCnt());//住房贷款笔数
			msZxInfoVo.setGzyhPersonalCommercialLoans(reqLoanAppBean.getIndvCmrclHsngLoanCnt());//个人商用房贷款笔数
			msZxInfoVo.setGzyhLCLongestAge(reqLoanAppBean.getCrCardLngstAcctAge());//贷记卡最长账龄
			msZxInfoVo.setGzyhAmtlBalSum(reqLoanAppBean.getLoanPnpBal());//贷款本金余额
			msZxInfoVo.setGzyhUnfinishLoans(reqLoanAppBean.getLoanUncldCnt());//贷款未结清笔数
			msZxInfoVo.setGzyhOperLoanBalance(reqLoanAppBean.getCrpnLoanBal());//经营性贷款余额
			msZxInfoVo.setGzyhFarmerLoanBalance(reqLoanAppBean.getFrmrLoanLoanBal());//农户贷款贷款余额
			msZxInfoVo.setGzyhPersonalLoanBalance(reqLoanAppBean.getIndvCnsmnLoanBal() );//个人消费贷款余额
			msZxInfoVo.setGzyhCFianceCompanyLoanBalance(reqLoanAppBean.getCnsmnFinCoLoanBal());//消费金融公司贷款余额
			msZxInfoVo.setGzyhSmallLoanCompanyBanlance(reqLoanAppBean.getSmlLndCoLoanBal());//小贷公司贷款余额
			msZxInfoVo.setGzyh1MCardEnquiries(reqLoanAppBean.getCrCardQryBrchCnt1());//最近1个月内信用卡查询机构数
			msZxInfoVo.setGzyh3MCardEnquiries(reqLoanAppBean.getCrCardQryBrchCnt2());//最近3个月内信用卡查询机构数
			msZxInfoVo.setGzyh6MCardEnquiries(reqLoanAppBean.getCrCardQryBrchCnt3());//最近6个月内信用卡查询机构数
			msZxInfoVo.setGzyh12MCardEnquiries(reqLoanAppBean.getCrCardQryBrchCnt4());//最近12个月内信用卡查询机构数
			msZxInfoVo.setGzyh24MCardEnquiries(reqLoanAppBean.getCrCardQryBrchCnt5());//最近24个月内信用卡查询机构数
			msZxInfoVo.setGzyh1MLoanEnquiries(reqLoanAppBean.getLoanQryBrchCnt1());//最近1个月内贷款查询机构数
			msZxInfoVo.setGzyh3MLoanEnquiries(reqLoanAppBean.getLoanQryBrchCnt2() );//最近3个月内贷款查询机构数
			msZxInfoVo.setGzyh6MLoanEnquiries(reqLoanAppBean.getLoanQryBrchCnt3());//最近6个月内贷款查询机构数
			msZxInfoVo.setGzyh12MLoanEnquiries(reqLoanAppBean.getLoanQryBrchCnt4());//最近12个月内贷款查询机构数
			msZxInfoVo.setGzyh24MLoanEnquiries(reqLoanAppBean.getLoanQryBrchCnt5());//最近24个月内贷款查询机构数
			msZxInfoVo.setGzyh12MOverdueM1(reqLoanAppBean.getCrCardOdueDfltTms1());//信用卡最近12个月逾期和违约M1的次数
			msZxInfoVo.setGzyh12MOverdueM2(reqLoanAppBean.getCrCardOdueDfltTms2());//信用卡最近12个月逾期和违约M2的次数
			msZxInfoVo.setGzyh12MOverdueM3(reqLoanAppBean.getCrCardOdueDfltTms3());//信用卡最近12个月逾期和违约M3的次数
			msZxInfoVo.setGzyh12MOverdueM4(reqLoanAppBean.getCrCardOdueDfltTms4());//信用卡最近12个月逾期和违约M4的次数
			msZxInfoVo.setGzyh12MOverdueBigThanM1(reqLoanAppBean.getCrCardOdueDfltTms5());//信用卡最近12个月逾期和违约M1及以上的次数
			msZxInfoVo.setGzyh12MOverdueBigThanM2(reqLoanAppBean.getCrCardOdueDfltTms6());//信用卡最近12个月逾期和违约M2及以上的次数
			msZxInfoVo.setGzyh12MOverdueBigThanM3(reqLoanAppBean.getCrCardOdueDfltTms7());//信用卡最近12个月逾期和违约M3及以上的次数
			msZxInfoVo.setGzyh12MOverdueBigThanM4(reqLoanAppBean.getCrCardOdueDfltTms8());//信用卡最近12个月逾期和违约M4及以上的次数
			msZxInfoVo.setGzyh12MMaxOverdueNum(reqLoanAppBean.getCrCardMxOdueDfltTms1());//信用卡最近12个月最大逾期和违约期数
			msZxInfoVo.setGzyh24MMaxOverdueNum(reqLoanAppBean.getCrCardMxOdueDfltTms2());//信用卡最近24个月最大逾期和违约期数
			msZxInfoVo.setGzyhCurrentAmtlCpdSum(reqLoanAppBean.getLoanCrnOdueSumDfltAmtAmt());//贷款当前逾期和违约金额
			msZxInfoVo.setGzyhCurrentAmtlCpdMax(reqLoanAppBean.getLoanCrnOdueSumDfltTrmCnt());//贷款当前逾期和违约期数
			msZxInfoVo.setGzyh12MlldOverdueBigThanM1(reqLoanAppBean.getLoanOdueDfltTms1() );//贷款最近12个月逾期和违约M1及以上的次数
			msZxInfoVo.setGzyh24MlldOverdueBigThanM1(reqLoanAppBean.getLoanOdueDfltTms2());//贷款最近24个月逾期和违约M1及以上的次数
			msZxInfoVo.setGzyh12MlldOverdueBigThanM2(reqLoanAppBean.getLoanOdueDfltTms3());//贷款最近12个月逾期和违约M2及以上的次数
			msZxInfoVo.setGzyh24MlldOverdueBigThanM2(reqLoanAppBean.getLoanOdueDfltTms4());//贷款最近24个月逾期和违约M2及以上的次数
			msZxInfoVo.setGzyh12MlldOverdueBigThanM3(reqLoanAppBean.getLoanOdueDfltTms5() );//贷款最近12个月逾期和违约M3及以上的次数
			msZxInfoVo.setGzyh24MlldOverdueBigThanM3(reqLoanAppBean.getLoanOdueDfltTms6());//贷款最近24个月逾期和违约M3及以上的次数
			msZxInfoVo.setGzyh12MlldOverdueBigThanM4(reqLoanAppBean.getLoanOdueDfltTms7());//贷款最近12个月逾期和违约M4及以上的次数
			msZxInfoVo.setGzyh24MlldOverdueBigThanM4(reqLoanAppBean.getLoanOdueDfltTms8());//贷款最近24个月逾期和违约M4及以上的次数
			msZxInfoVo.setGzyh12MlldOverdueMax(reqLoanAppBean.getLoanMxOdueDfltTrmCnt1());//贷款最近12个月最大的逾期和违约期数
			msZxInfoVo.setGzyh24MlldOverdueMax(reqLoanAppBean.getLoanMxOdueDfltTrmCnt2());//贷款最近24个月最大的逾期和违约期数
			msZxInfoVo.setGzyhIsCreditWhite(reqLoanAppBean.getCrRfrncRprtRcrdFlg());//征信报告记录标志
			msZxInfoVo.setGzyhIfHaveBasicInfo(reqLoanAppBean.getCustInfRcrdFlg());//客户信息记录标志
			msZxInfoVo.setGzyhIsLOvdue(reqLoanAppBean.getLoanStFlg());//贷款状态标志
			msZxInfoVo.setGzyhIsLCollecting(reqLoanAppBean.getCllctnStFlg());//催收状态标志
			msZxInfoVo.setGzyhIsCFrozen(reqLoanAppBean.getCrCardFrzStopPymtFlg());//贷记卡冻结止付标志
			msZxInfoVo.setGzyhIsSFrozen(reqLoanAppBean.getQscrdtFrzStopPymtFlg());//准贷记卡冻结止付标志
			msZxInfoVo.setGzyhIfFiveClassUnnormal(reqLoanAppBean.getLoanClsfStFlg());//贷款分类状态标志
			msZxInfoVo.setGzyhIsSOvdueMThan180D(reqLoanAppBean.getQscrdtNonRpymtMnyRcrdFlg());//准贷记卡未还款记录标志
			msZxInfoVo.setGzyh1MCardEnquiriesLC(reqLoanAppBean.getNrOneMosQryTms());//近一个月查询次数
			msZxInfoVo.setGzyhCMaxContinuePdNum12m(reqLoanAppBean.getCrCardOdueFlg2());//贷记卡最近12个月内是否存在连续3次及以上逾期标志
			msZxInfoVo.setGzyhSMaxContinuePdNum12m(reqLoanAppBean.getQscrdtOdueFlg2());//准贷记卡最近12个月内是否存在连续3次及以上逾期标志
			msZxInfoVo.setGzyhCTotalPdNum12m(reqLoanAppBean.getCrCardOdueTotAmt());//贷记卡最近12个月内累计逾期次数
			msZxInfoVo.setGzyhSTotalPdNum12m(reqLoanAppBean.getQscrdtAcmlnOdueTms());//准贷记卡最近12个月内累计逾期次数
			msZxInfoVo.setGzyhLMaxContinuePdNum12m(reqLoanAppBean.getLoanCtnsOdueJdg());//贷款最近12个月内否是存在连续3次及以上逾期
			msZxInfoVo.setGzyhLTotalPdNum12m(reqLoanAppBean.getLoanAcmlnOdueTms());//贷款最近12个月内累计逾期次数
			msZxInfoVo.setTIME_REP(reqLoanAppBean.getRprtTm());//报告时间
			msZxInfoVo.setGzyhCMaxUsedRate(reqLoanAppBean.getCardSnglHghstLmtUseRt());//卡单笔最高额度使用率
			msZxInfoVo.setGzyh3MCardEnquiriesLC(reqLoanAppBean.getNr3MosAprvlQry());//近3个月审批查询
			msZxInfoVo.setGzyhUnclosedLoanInsNum(reqLoanAppBean.getUncldLoanBrchCnt());//未结清贷款机构数量
			msZxInfoVo.setGzyhUnclosedLoanContrAmt(reqLoanAppBean.getUncldLoanContrTotAmt());//未结清贷款合同总额
			msZxInfoVo.setZxReserveField1("");
			msZxInfoVo.setZxReserveField2("");
			msZxInfoVo.setZxReserveField3("");
			int num4 = msZxInfoService.insertMsZxInfo(msZxInfoVo);
			//================================插入征信信息到征信信息表end=====================================

			// 5.组装返回报文
			if (num1 == -1 || num2 == -1 || num3 == -1 || num4 == -1) {
				logger.debug("插入数据表异常! 组装报文返回**************");
				return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean,
						JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.SJCLYC.getValue(), "插入数据表异常!")),
						EsbSysHeadEnums.RetStEnum.FAILURE.getCode(),  EsbRetCodeStandard.SJCLYC.getValue(), "插入数据表异常!");
			} else {
				producerService.sendMsg(new Message(TopicEnums.QUEUE_TASK_TOPIC.getTopicId(), TagEnums.TAG_QUEUE_TASK.getTagId(), applSeq,
						JSON.toJSONString(nlsApplyInfoVO).getBytes("UTF-8")));

				try {
					//风控大屏展示-马上进件的每一笔都要发送数据过去，不管是否发送成功，都不影响马上进件 dengqiwen 20200414
					logger.info("马上进件申请交易，发送kafka消息给大数据开始");
					BigShowVO array =new BigShowVO();
					array.setSysName("网贷");
					array.setApplyNo(applSeq);
					array.setAmountCategory(nlsApplyInfoVO.getApplyAmt());
					array.setProductName(prdName);
					array.setName(cusName);
					array.setCertNo(certNo);
					array.setPhoneNum(mobile);
					String timeStamp = TimeUtil.getTimeStampByPattern("yyyyMMdd HH:mm:ss"); //数据日期
					array.setDateTime(timeStamp);
					//把对象装进list在用map.put的原因是因为要满足大数据对json报文的格式要求
					List<BigShowVO> jsonObjects = new ArrayList<BigShowVO>();
					jsonObjects.add(array);
					Map<String,Object> map = new HashMap<String,Object>();
					map.put("array",jsonObjects);
					//单例线程池
					ThreadFactory threadFactoryBuilder = new ThreadFactoryBuilder().setNameFormat("ms-bigShow-singleThreadPool").build();
					ThreadPoolExecutor singleThreadPool = new ThreadPoolExecutor(1,1,0L,
							TimeUnit.MICROSECONDS,new LinkedBlockingDeque<Runnable>(1024),
							threadFactoryBuilder,new ThreadPoolExecutor.AbortPolicy());
					singleThreadPool.execute(new Runnable() {
                        @Override
                        public void run() {
                            KafkaUtil kafka=new KafkaUtil(servers,kafkaToptic);
                            try {
                                kafka.sendMessage(GsonUtils.toJson(map));
                            } catch (Exception e) {
                                e.printStackTrace();
                                logger.error("马上进件申请交易，发送kafka消息给大数据失败，申请流水号："+applSeq+"，异常信息：" + e.getMessage());
                            }
                        }
                    });
					singleThreadPool.shutdown();
					logger.info("马上进件申请交易，发送kafka消息给大数据结束，申请流水号："+applSeq);
				} catch (Exception e) {
					logger.error("马上进件申请交易，发送kafka消息给大数据失败，申请流水号："+applSeq+"，异常信息：" + e.getMessage());
				}

				return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean,
						JSON.toJSONString(buildRespLoanAppBean(EsbBizEnums.RetCodeEnum.SUCCESS.getVALUE(), "交易成功")),
						EsbSysHeadEnums.RetStEnum.SUCCESS.getCode(), EsbBizEnums.RetCodeEnum.SUCCESS.getVALUE(), "交易成功");
			}
		} catch (BizException e) {
			logger.error("马上申请审批服务接口处理失败!" + e.getMessage());
			return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean,
					JSON.toJSONString(buildRespLoanAppBean(e.getErrorCode(), e.getMessage())),
					EsbSysHeadEnums.RetStEnum.FAILURE.getCode(), e.getErrorCode(), e.getMessage());
		} catch (Exception e) {
			logger.error("马上申请审批服务接口处理失败!" + e.getMessage());
			return EsbRespServiceBeanCreator.buildesbRespServiceBean(esbReqServiceBean,
					JSON.toJSONString(buildRespLoanAppBean(EsbRetCodeStandard.OTHERS_EXCEPTION.getValue(), e.getMessage())),
					EsbSysHeadEnums.RetStEnum.FAILURE.getCode(), EsbRetCodeStandard.OTHERS_EXCEPTION.getValue(), e.getMessage());
		} finally {
			logger.info("马上进件申请交易结束----------申请流水号：" + applSeq + "------------全局流水号" + glblSrlNo);
			TraceUtil.clear();
		}
	}

	/**
	 * 组织用户借款请求接口的返回对象
	 * 
	 * @param retStCd
	 *            返回状态码
	 * @param rtnMsg
	 *            返回信息
	 * @return
	 * @author huangwb
	 * @since 2019年1月20日 下午1:59:46
	 * @version 1.0
	 */
	private RespLoanAppBean buildRespLoanAppBean(String retStCd, String rtnMsg) {
		RespLoanAppBean respLoanAppBean = new RespLoanAppBean();
		respLoanAppBean.setRetStCd(retStCd);
		respLoanAppBean.setRtnMsg(rtnMsg);
		respLoanAppBean.setBankInWrongCd("");
		respLoanAppBean.setBankInWrongRsn("");
		respLoanAppBean.setSynDistrFlg("");
		respLoanAppBean.setLoanOrdrNo("");
		respLoanAppBean.setBankCustNo("");
		return respLoanAppBean;
	}

	/* 生成联系人表id S000000001 */
	public String getCusId() throws Exception {
		return sequenceService.getPatternedSequence("RELATION_ID", PATTERN);
	}

	@Autowired
	@Qualifier("nlsApplyInfoService")
	private NlsApplyInfoService nlsApplyInfoService;
	@Autowired
	@Qualifier("nlsApplyRelationService")
	private NlsApplyRelationService nlsApplyRelationService;
//	@Autowired
//	@Qualifier("nlsQueueTaskService")
//	private NlsQueueTaskService nlsQueueTaskService;
	@Autowired
	@Qualifier("nlsProcessBizService")
	private NlsProcessBizService nlsProcessBizService;
	@Autowired
	@Qualifier("cusIndivService")
	private CusIndivService cusIndivService;
	@Autowired
	@Qualifier("prdInfoService")
	private PrdInfoService prdInfoService;
//	@Autowired
//	@Qualifier("prdAdaptedSoltService")
//	private PrdAdaptedSoltService prdAdaptedSoltService;
//	@Autowired
//	@Qualifier("pubSysInfoService")
//	private PubSysInfoService pubSysInfoService;
	@Autowired
	private PatternedLimitableSeqService sequenceService;
	@Autowired
	@Qualifier("producerService")
	private MQProducerMessageClient producerService;

	@Autowired
	@Qualifier("msZxService")
	private MsZxInfoService msZxInfoService;
}
